<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Data::Alias - Comprehensive set of aliasing operations - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Data-Alias - MetaCPAN" href="https://metacpan.org/dist/Data-Alias/releases.rss" />
        <link rel="canonical" href="./Data::Alias.html" />
        <meta name="description" content="Comprehensive set of aliasing operations" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Data::Alias" />
<meta name="twitter:title"       content="Data::Alias" />
<meta name="twitter:description" content="Comprehensive set of aliasing operations" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Data::Alias.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Data-Alias was released.">
      <span class="relatize">21 Dec 2022 16:45:45 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Data-Alias">Data-Alias</a>
  </li>
  <li>
    Module version: 1.28
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Data-Alias/source/lib/Data/Alias.pm">Source</a>
    (<a href="https://metacpan.org/dist/Data-Alias/source/lib/Data/Alias.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Data-Alias/source/lib/Data">Browse</a>
    (<a href="https://metacpan.org/dist/Data-Alias/source/lib/Data?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Data-Alias/changes">Changes</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Data-Alias/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/mvduin/perl-Data-Alias">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Alias">Issues</a>
      (1)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Data-Alias+1.28" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Alias.html?oncpan=1&amp;distmat=1&amp;version=1.28&amp;grade=2" style="color: #090">640</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Alias.html?oncpan=1&amp;distmat=1&amp;version=1.28&amp;grade=3" style="color: #900">4</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Alias.html?oncpan=1&amp;distmat=1&amp;version=1.28&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/XMATH/Data-Alias-1.28">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Data-Alias who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 2
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Data-Alias-1.28/index.html">75.78% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li>
      Perl: v5.6.0
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Data-Alias/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/X/XM/XMATH/Data-Alias-1.28.tar.gz">
      Download (<span itemprop="fileSize">55.64KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FXMATH%2FData-Alias-1.28%2Flib%2FData%2FAlias.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Data-Alias/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Data-Alias/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Data-Alias">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Data-Alias">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Data/Alias.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="XMATH/Data-Alias-1.28"
>1.28
  (XMATH on 2022-12-21)</option>
<option
  
  value="XMATH/Data-Alias-1.27"
>1.27
  (XMATH on 2022-12-02)</option>
<option
  
  value="XMATH/Data-Alias-1.25_01"
>1.25_01 DEV
  (XMATH on 2021-05-15)</option>
<option
  
  value="XMATH/Data-Alias-1.25"
>1.25
  (XMATH on 2021-05-11)</option>
<option
  
  value="XMATH/Data-Alias-1.24"
>1.24
  (XMATH on 2021-05-05)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.21"
>1.21
  (ZEFRAM on 2017-12-08)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.20"
>1.20
  (ZEFRAM on 2015-10-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.19"
>1.19
  (ZEFRAM on 2015-10-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.18"
>1.18
  (ZEFRAM on 2013-09-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.17"
>1.17
  (ZEFRAM on 2013-08-04)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.16"
>1.16
  (ZEFRAM on 2011-11-17)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.15"
>1.15
  (ZEFRAM on 2011-06-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.14"
>1.14
  (ZEFRAM on 2011-04-27)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.13"
>1.13
  (ZEFRAM on 2011-04-25)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.12"
>1.12
  (ZEFRAM on 2011-02-22)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.11"
>1.11
  (ZEFRAM on 2011-01-13)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.10"
>1.10
  (ZEFRAM on 2010-11-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.09"
>1.09
  (ZEFRAM on 2010-11-15)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.08"
>1.08
  (ZEFRAM on 2010-10-22)</option>
<optgroup label="BackPAN">'
<option
  
  value="XMATH/Data-Alias-1.26"
>1.26
  (XMATH on 2022-12-01)</option>
<option
  
  value="XMATH/Data-Alias-1.24_01"
>1.24_01 DEV
  (XMATH on 2021-05-07)</option>
<option
  
  value="XMATH/Data-Alias-1.23"
>1.23
  (XMATH on 2021-04-30)</option>
<option
  
  value="XMATH/Data-Alias-1.22"
>1.22
  (XMATH on 2021-04-22)</option>
<option
  
  value="XMATH/Data-Alias-1.07"
>1.07
  (XMATH on 2007-09-10)</option>
<option
  
  value="XMATH/Data-Alias-1.06"
>1.06
  (XMATH on 2007-06-28)</option>
<option
  
  value="XMATH/Data-Alias-1.05"
>1.05
  (XMATH on 2007-05-13)</option>
<option
  
  value="XMATH/Data-Alias-1.04"
>1.04
  (XMATH on 2007-05-03)</option>
<option
  
  value="XMATH/Data-Alias-1.03"
>1.03
  (XMATH on 2007-03-16)</option>
<option
  
  value="XMATH/Data-Alias-1.02"
>1.02
  (XMATH on 2007-01-09)</option>
<option
  
  value="XMATH/Data-Alias-1.01"
>1.01
  (XMATH on 2006-09-29)</option>
<option
  
  value="XMATH/Data-Alias-1.0"
>1.0
  (XMATH on 2006-07-12)</option>
<option
  
  value="XMATH/Data-Alias-0.1"
>0.1
  (XMATH on 2006-06-03)</option>
<option
  
  value="XMATH/Data-Alias-0.09"
>0.09
  (XMATH on 2006-05-22)</option>
<option
  
  value="XMATH/Data-Alias-0.08"
>0.08
  (XMATH on 2006-02-08)</option>
<option
  
  value="XMATH/Data-Alias-0.07"
>0.07
  (XMATH on 2006-02-06)</option>
<option
  
  value="XMATH/Data-Alias-0.06"
>0.06
  (XMATH on 2006-02-05)</option>
<option
  
  value="XMATH/Data-Alias-0.05"
>0.05
  (XMATH on 2006-02-02)</option>
<option
  
  value="XMATH/Data-Alias-0.04"
>0.04
  (XMATH on 2004-08-29)</option>
<option
  
  value="XMATH/Data-Alias-0.03"
>0.03
  (XMATH on 2004-08-29)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/XMATH/Data-Alias-1.28/diff/' + encodeURIComponent(this.value) + '/lib/Data/Alias.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="XMATH/Data-Alias-1.28"
>1.28
  (XMATH on 2022-12-21)</option>
<option
  
  value="XMATH/Data-Alias-1.27"
>1.27
  (XMATH on 2022-12-02)</option>
<option
  
  value="XMATH/Data-Alias-1.25_01"
>1.25_01 DEV
  (XMATH on 2021-05-15)</option>
<option
  
  value="XMATH/Data-Alias-1.25"
>1.25
  (XMATH on 2021-05-11)</option>
<option
  
  value="XMATH/Data-Alias-1.24"
>1.24
  (XMATH on 2021-05-05)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.21"
>1.21
  (ZEFRAM on 2017-12-08)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.20"
>1.20
  (ZEFRAM on 2015-10-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.19"
>1.19
  (ZEFRAM on 2015-10-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.18"
>1.18
  (ZEFRAM on 2013-09-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.17"
>1.17
  (ZEFRAM on 2013-08-04)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.16"
>1.16
  (ZEFRAM on 2011-11-17)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.15"
>1.15
  (ZEFRAM on 2011-06-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.14"
>1.14
  (ZEFRAM on 2011-04-27)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.13"
>1.13
  (ZEFRAM on 2011-04-25)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.12"
>1.12
  (ZEFRAM on 2011-02-22)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.11"
>1.11
  (ZEFRAM on 2011-01-13)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.10"
>1.10
  (ZEFRAM on 2010-11-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.09"
>1.09
  (ZEFRAM on 2010-11-15)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.08"
>1.08
  (ZEFRAM on 2010-10-22)</option>
<optgroup label="BackPAN">'
<option
  
  value="XMATH/Data-Alias-1.26"
>1.26
  (XMATH on 2022-12-01)</option>
<option
  
  value="XMATH/Data-Alias-1.24_01"
>1.24_01 DEV
  (XMATH on 2021-05-07)</option>
<option
  
  value="XMATH/Data-Alias-1.23"
>1.23
  (XMATH on 2021-04-30)</option>
<option
  
  value="XMATH/Data-Alias-1.22"
>1.22
  (XMATH on 2021-04-22)</option>
<option
  
  value="XMATH/Data-Alias-1.07"
>1.07
  (XMATH on 2007-09-10)</option>
<option
  
  value="XMATH/Data-Alias-1.06"
>1.06
  (XMATH on 2007-06-28)</option>
<option
  
  value="XMATH/Data-Alias-1.05"
>1.05
  (XMATH on 2007-05-13)</option>
<option
  
  value="XMATH/Data-Alias-1.04"
>1.04
  (XMATH on 2007-05-03)</option>
<option
  
  value="XMATH/Data-Alias-1.03"
>1.03
  (XMATH on 2007-03-16)</option>
<option
  
  value="XMATH/Data-Alias-1.02"
>1.02
  (XMATH on 2007-01-09)</option>
<option
  
  value="XMATH/Data-Alias-1.01"
>1.01
  (XMATH on 2006-09-29)</option>
<option
  
  value="XMATH/Data-Alias-1.0"
>1.0
  (XMATH on 2006-07-12)</option>
<option
  
  value="XMATH/Data-Alias-0.1"
>0.1
  (XMATH on 2006-06-03)</option>
<option
  
  value="XMATH/Data-Alias-0.09"
>0.09
  (XMATH on 2006-05-22)</option>
<option
  
  value="XMATH/Data-Alias-0.08"
>0.08
  (XMATH on 2006-02-08)</option>
<option
  
  value="XMATH/Data-Alias-0.07"
>0.07
  (XMATH on 2006-02-06)</option>
<option
  
  value="XMATH/Data-Alias-0.06"
>0.06
  (XMATH on 2006-02-05)</option>
<option
  
  value="XMATH/Data-Alias-0.05"
>0.05
  (XMATH on 2006-02-02)</option>
<option
  
  value="XMATH/Data-Alias-0.04"
>0.04
  (XMATH on 2004-08-29)</option>
<option
  
  value="XMATH/Data-Alias-0.03"
>0.03
  (XMATH on 2004-08-29)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Carp" title="Carp" class="ellipsis">Carp</a></li>
  <li><a href="https://metacpan.org/pod/Exporter" title="Exporter" class="ellipsis">Exporter</a></li>
  <li><a href="https://metacpan.org/pod/strict" title="strict" class="ellipsis">strict</a></li>
  <li><a href="https://metacpan.org/pod/vars" title="vars" class="ellipsis">vars</a></li>
  <li><a href="https://metacpan.org/pod/warnings" title="warnings" class="ellipsis">warnings</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Data::Alias/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Data%3A%3AAlias">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Data-Alias">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/XMATH/Data-Alias-1.28/view/lib/Data/Alias.pm">This version</a>
    </li>
    <li>
      <a href="./Data::Alias.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/SSCAFFIDI"><img src="https://www.gravatar.com/avatar/2b2258ad3913c3d9a32123b905101a8b?d=identicon&amp;s=20" title="SSCAFFIDI" alt="SSCAFFIDI"></a>
<a class="display-all" href="https://metacpan.org/author/CONTRA"><img src="https://www.gravatar.com/avatar/0c6e9af22d57e7e8641517069078da5b?d=identicon&amp;s=20" title="CONTRA" alt="CONTRA"></a>
<a class="display-all" href="https://metacpan.org/author/KES"><img src="https://www.gravatar.com/avatar/e8530f00b43b4f6a056f8ad4ee52ea47?d=identicon&amp;s=20" title="KES" alt="KES"></a>
<a class="display-all" href="https://metacpan.org/author/MOCNII"><img src="https://www.gravatar.com/avatar/d39486cfc3af19d1e5dbaedc626507b7?d=identicon&amp;s=20" title="MOCNII" alt="MOCNII"></a>
<a class="display-all" href="https://metacpan.org/author/HANNIBAL"><img src="https://www.gravatar.com/avatar/325c153e70a65543b9496e0ad7cdca29?d=identicon&amp;s=20" title="HANNIBAL" alt="HANNIBAL"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Data-Alias/plussers">8 PAUSE users</a>
</div>
<div>
    10 non-PAUSE users
</div>
</div>
    </li>
    <li>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/XMATH" class="author-name">Matthijs van Duin</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Data/Alias.pm&#39;" class="">
<option
  selected
  value="XMATH/Data-Alias-1.28"
>1.28
  (XMATH on 2022-12-21)</option>
<option
  
  value="XMATH/Data-Alias-1.27"
>1.27
  (XMATH on 2022-12-02)</option>
<option
  
  value="XMATH/Data-Alias-1.25_01"
>1.25_01 DEV
  (XMATH on 2021-05-15)</option>
<option
  
  value="XMATH/Data-Alias-1.25"
>1.25
  (XMATH on 2021-05-11)</option>
<option
  
  value="XMATH/Data-Alias-1.24"
>1.24
  (XMATH on 2021-05-05)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.21"
>1.21
  (ZEFRAM on 2017-12-08)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.20"
>1.20
  (ZEFRAM on 2015-10-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.19"
>1.19
  (ZEFRAM on 2015-10-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.18"
>1.18
  (ZEFRAM on 2013-09-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.17"
>1.17
  (ZEFRAM on 2013-08-04)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.16"
>1.16
  (ZEFRAM on 2011-11-17)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.15"
>1.15
  (ZEFRAM on 2011-06-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.14"
>1.14
  (ZEFRAM on 2011-04-27)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.13"
>1.13
  (ZEFRAM on 2011-04-25)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.12"
>1.12
  (ZEFRAM on 2011-02-22)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.11"
>1.11
  (ZEFRAM on 2011-01-13)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.10"
>1.10
  (ZEFRAM on 2010-11-21)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.09"
>1.09
  (ZEFRAM on 2010-11-15)</option>
<option
  
  value="ZEFRAM/Data-Alias-1.08"
>1.08
  (ZEFRAM on 2010-10-22)</option>
<optgroup label="BackPAN">'
<option
  
  value="XMATH/Data-Alias-1.26"
>1.26
  (XMATH on 2022-12-01)</option>
<option
  
  value="XMATH/Data-Alias-1.24_01"
>1.24_01 DEV
  (XMATH on 2021-05-07)</option>
<option
  
  value="XMATH/Data-Alias-1.23"
>1.23
  (XMATH on 2021-04-30)</option>
<option
  
  value="XMATH/Data-Alias-1.22"
>1.22
  (XMATH on 2021-04-22)</option>
<option
  
  value="XMATH/Data-Alias-1.07"
>1.07
  (XMATH on 2007-09-10)</option>
<option
  
  value="XMATH/Data-Alias-1.06"
>1.06
  (XMATH on 2007-06-28)</option>
<option
  
  value="XMATH/Data-Alias-1.05"
>1.05
  (XMATH on 2007-05-13)</option>
<option
  
  value="XMATH/Data-Alias-1.04"
>1.04
  (XMATH on 2007-05-03)</option>
<option
  
  value="XMATH/Data-Alias-1.03"
>1.03
  (XMATH on 2007-03-16)</option>
<option
  
  value="XMATH/Data-Alias-1.02"
>1.02
  (XMATH on 2007-01-09)</option>
<option
  
  value="XMATH/Data-Alias-1.01"
>1.01
  (XMATH on 2006-09-29)</option>
<option
  
  value="XMATH/Data-Alias-1.0"
>1.0
  (XMATH on 2006-07-12)</option>
<option
  
  value="XMATH/Data-Alias-0.1"
>0.1
  (XMATH on 2006-06-03)</option>
<option
  
  value="XMATH/Data-Alias-0.09"
>0.09
  (XMATH on 2006-05-22)</option>
<option
  
  value="XMATH/Data-Alias-0.08"
>0.08
  (XMATH on 2006-02-08)</option>
<option
  
  value="XMATH/Data-Alias-0.07"
>0.07
  (XMATH on 2006-02-06)</option>
<option
  
  value="XMATH/Data-Alias-0.06"
>0.06
  (XMATH on 2006-02-05)</option>
<option
  
  value="XMATH/Data-Alias-0.05"
>0.05
  (XMATH on 2006-02-02)</option>
<option
  
  value="XMATH/Data-Alias-0.04"
>0.04
  (XMATH on 2004-08-29)</option>
<option
  
  value="XMATH/Data-Alias-0.03"
>0.03
  (XMATH on 2004-08-29)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Data-Alias">Data-Alias-1.28</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage two &#10;
          • 14 direct dependents &#10;          • 15 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Data-Alias-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Data-Alias-1.28">
    <input type="hidden" name="author" value="XMATH">
    <input type="hidden" name="distribution" value="Data-Alias">
    <button type="submit" class="favorite highlight"><span>18</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Data::Alias.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>18</span> ++</a>
</div>
   / <span>Data::Alias</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Data::Alias.html#NAME">NAME</a></li>
  <li><a href="./Data::Alias.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Data::Alias.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Data::Alias.html#SYNTAX">SYNTAX</a>
    <ul>
      <li><a href="./Data::Alias.html#alias-EXPR-%7C-alias-BLOCK">alias EXPR | alias BLOCK</a></li>
      <li><a href="./Data::Alias.html#copy-EXPR-%7C-copy-BLOCK">copy EXPR | copy BLOCK</a></li>
      <li><a href="./Data::Alias.html#deref-LIST">deref LIST</a></li>
    </ul>
  </li>
  <li><a href="./Data::Alias.html#EXAMPLES">EXAMPLES</a></li>
  <li><a href="./Data::Alias.html#DETAILS">DETAILS</a></li>
  <li><a href="./Data::Alias.html#IMPLEMENTATION">IMPLEMENTATION</a></li>
  <li><a href="./Data::Alias.html#KNOWN-ISSUES">KNOWN ISSUES</a></li>
  <li><a href="./Data::Alias.html#ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</a></li>
  <li><a href="./Data::Alias.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./Data::Alias.html#LICENSE">LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Data::Alias - Comprehensive set of aliasing operations</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    use Data::Alias;

    alias {
            # aliasing instead of copying whenever possible
    };

    alias $x = $y;              # alias $x to $y
    alias @x = @y;              # alias @x to @y
    alias $x[0] = $y;           # similar for array and hash elements
    alias push @x, $y;          # push alias to $y onto @x
    $x = alias [ $y, $z ];      # construct array of aliases
    alias my ($x, $y) = @_;     # named aliases to arguments
    alias { ($x, $y) = ($y, $x) };              # swap $x and $y
    alias { my @t = @x; @x = @y; @y = @t };     # swap @x and @y

    use Data::Alias qw/ alias copy /;

    alias { copy $x = $y };     # force copying inside alias-BLOCK

    use Data::Alias qw/ deref /;

    my @refs = (\$x, \@y, \%z);
    foo(deref @refs)            # same as foo($x, @y, %z)</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>Aliasing is the phenomenon where two different expressions actually refer to the same thing. Modifying one will modify the other, and if you take a reference to both, the two values are the same.</p>

<p>Aliasing occurs in Perl for example in for-loops and sub-calls:</p>

<pre><code>    for $var ($x) {
            # here $var is an alias to $x
    }

    foo($y);
    sub foo {
            # here $_[0] is an alias to $y
    }</code></pre>

<p>Data::Alias is a module that allows you to apply &quot;aliasing semantics&quot; to a section of code, causing aliases to be made wherever Perl would normally make copies instead. You can use this to improve efficiency and readability, when compared to using references.</p>

<p>The exact details of aliasing semantics are below under <a href="./Data::Alias.html#DETAILS">&quot;DETAILS&quot;</a>.</p>

<p>Perl 5.22 added some support for aliasing to the Perl core. It has a different syntax, and a different set of operations, from that supplied by this module; see <a href="https://metacpan.org/pod/perlref#Assigning-to-References">&quot;Assigning to References&quot; in perlref</a>. The core&#39;s aliasing facilities are implemented more robustly than this module and are better supported. If you can rely on having a sufficiently recent Perl version, you should prefer to use the core facility rather than use this module. If you are already using this module and are now using a sufficiently recent Perl, you should attempt to migrate to the core facility.</p>

<h1 id="SYNTAX">SYNTAX</h1>

<h2 id="alias-EXPR-|-alias-BLOCK"><a id="alias"></a><a id="alias-EXPR---alias-BLOCK"></a>alias <i>EXPR</i> | alias <i>BLOCK</i></h2>

<p>Exported by default.</p>

<p>Enables aliasing semantics within the expression or block. Returns an alias to the expression, or the block&#39;s return value.</p>

<p><code>alias</code> is context-transparent, meaning that whichever context it is placed in (list, scalar, void), the expression/block is evaluated in the same context.</p>

<h2 id="copy-EXPR-|-copy-BLOCK"><a id="copy"></a><a id="copy-EXPR---copy-BLOCK"></a>copy <i>EXPR</i> | copy <i>BLOCK</i></h2>

<p>Restores normal (copying) semantics within the expression or block, and makes a copy of the result value (unless in void context).</p>

<p>Like <code>alias</code>, <code>copy</code> is context-transparent.</p>

<h2 id="deref-LIST"><a id="deref"></a>deref <i>LIST</i></h2>

<p>Accepts a list of references to scalars, arrays, or hashes. Applies the applicable dereferencing operator to each. This means that:</p>

<pre><code>    deref $scalarref, $arrayref, $hashref</code></pre>

<p>behaves like:</p>

<pre><code>    $$scalarref, @$arrayref, %$hashref</code></pre>

<p>Where an array or hash reference is given, the returned list does not include the array or hash as an lvalue; the array/hash is expanded and the list includes its elements. Scalars, including the elements of an array/hash, <i>are</i> treated as lvalues, and can be enreferenced using the <code>\</code> operator or aliased to using the <code>alias</code> operator. This is slightly different from what you&#39;d get using the built-in dereference operators: <code>@$arrayref</code> references the array as an lvalue, so <code>\</code> or <code>alias</code> can operate on the array itself rather than just its elements.</p>

<h1 id="EXAMPLES">EXAMPLES</h1>

<p>A common usage of aliasing is to make an abbreviation for an expression, to avoid having to repeat that (possibly verbose or ugly) expression over and over:</p>

<pre><code>    alias my $fi = $self-&gt;{FrobnitzIndex};
    $fi = $fi &gt; 0 ? $fi - $adj : $fi + $adj;

    sub rc4 {
            alias my ($i, $j, $S) = @_;
            my $a = $S-&gt;[($i += 1) &amp;= 255];
            my $b = $S-&gt;[($j += $S-&gt;[$i]) &amp;= 255];
            $S-&gt;[(($S-&gt;[$j] = $a) + ($S-&gt;[$i] = $b)) &amp; 255]
    }</code></pre>

<p>In the second example, the rc4 function updates its first two arguments (two state values) in addition to returning a value.</p>

<p>Aliasing can also be used to avoid copying big strings. This example would work fine without <code>alias</code> but would be much slower when passed a big string:</p>

<pre><code>    sub middlesection ($) {
            alias my $s = shift;
            substr $s, length($s)/4, length($s)/2
    }</code></pre>

<p>You can also apply aliasing semantics to an entire block. Here this is used to swap two arrays in O(1) time:</p>

<pre><code>    alias {
            my @temp = @x;
            @x = @y;
            @y = @temp;
    };</code></pre>

<p>The <code>copy</code> function is typically used to temporarily reinstate normal semantics, but can also be used to explicitly copy a value when perl would normally not do so:</p>

<pre><code>    my $ref = \copy $x;</code></pre>

<h1 id="DETAILS">DETAILS</h1>

<p>This section describes exactly what the aliasing semantics are of operations. Anything not listed below has unaltered behaviour.</p>

<dl>

<dt id="scalar-assignment-to-variable-or-element."><a id="scalar"></a><a id="scalar-assignment-to-variable-or-element"></a>scalar assignment to variable or element.</dt>
<dd>

<p>Makes the left-side of the assignment an alias to the right-side expression, which can be anything.</p>

<pre><code>    alias my $lexvar = $foo;
    alias $pkgvar = $foo;
    alias $array[$i] = $foo;
    alias $hash{$k} = $foo;</code></pre>

<p>An attempt to do alias-assignment to an element of a tied (or &quot;magical&quot;) array or hash will result in a &quot;Can&#39;t put alias into tied array/hash&quot; error.</p>

</dd>
<dt id="scalar-assignment-to-dereference"><a id="scalar1"></a>scalar assignment to dereference</dt>
<dd>

<p>If $ref is a reference or undef, this simply does <code>$ref = \$foo</code>. Otherwise, the indicated package variable (via glob or symbolic reference) is made an alias to the right-side expression.</p>

<pre><code>    alias $$ref = $foo;</code></pre>

</dd>
<dt id="scalar-assignment-to-glob"><a id="scalar2"></a>scalar assignment to glob</dt>
<dd>

<p>Works mostly the same as normal glob-assignment, however it does not set the import-flag. (If you don&#39;t know what this means, you probably don&#39;t care)</p>

<pre><code>    alias *glob = $reference;</code></pre>

</dd>
<dt id="scalar-assignment-to-anything-else"><a id="scalar3"></a>scalar assignment to anything else</dt>
<dd>

<p>Not supported.</p>

<pre><code>    alias substr(...) = $foo;   # ERROR!
    alias lvalsub() = $foo;     # ERROR!</code></pre>

</dd>
<dt id="conditional-scalar-assignment"><a id="conditional"></a>conditional scalar assignment</dt>
<dd>

<p>Here <code>$var</code> (and <code>$var2</code>) are aliased to <code>$foo</code> if the applicable condition is satisfied. <code>$bool</code> and <code>$foo</code> can be any expression. <code>$var</code> and <code>$var2</code> can be anything that is valid on the left-side of an alias-assignment.</p>

<pre><code>    alias $bool ? $var : $var2 = $foo;
    alias $var &amp;&amp;= $foo;
    alias $var ||= $foo;
    alias $var //= $foo; # (perl 5.9.x or later)</code></pre>

</dd>
<dt id="whole-aggregate-assignment-from-whole-aggregate"><a id="whole"></a>whole aggregate assignment from whole aggregate</dt>
<dd>

<p>This occurs where the expressions on both sides of the assignment operator are purely complete arrays or hashes. The entire aggregate is aliased, not merely the contents. This means for example that <code>\@lexarray == \@foo</code>.</p>

<pre><code>    alias my @lexarray = @foo;
    alias my %lexhash = %foo;
    alias @pkgarray = @foo;
    alias %pkghash = %foo;</code></pre>

<p>Making the left-side a dereference is also supported:</p>

<pre><code>    alias @$ref = @foo;
    alias %$ref = %foo;</code></pre>

<p>and analogously to assignment to scalar dereference, these will change <code>$ref</code> to reference the aggregate, if <code>$ref</code> was undef or already a reference. If <code>$ref</code> is a string or glob, the corresponding package variable is aliased.</p>

<p>Anything more complex than a whole-aggregate expression on either side, even just enclosing the aggregate expression in parentheses, will prevent the assignment qualifying for this category. It will instead go into one of the following two categories. Parenthesisation is the recommended way to avoid whole-aggregate aliasing where it is unwanted. If you want to merely replace the contents of the left-side aggregate with aliases to the contents of the right-side aggregate, parenthesise the left side.</p>

</dd>
<dt id="whole-aggregate-assignment-from-list"><a id="whole1"></a>whole aggregate assignment from list</dt>
<dd>

<p>If the left-side expression is purely a complete array or hash, and the right-side expression is not purely a matching aggregate, then a new aggregate is implicitly constructed. This means:</p>

<pre><code>    alias my @lexfoo = (@foo);
    alias my @array = ($x, $y, $z);
    alias my %hash = (x =&gt; $x, y =&gt; $y);</code></pre>

<p>is translated to:</p>

<pre><code>    alias my @lexfoo = @{ [@foo] };
    alias my @array = @{ [$x, $y, $z] };
    alias my %hash = %{ {x =&gt; $x, y =&gt; $y} };</code></pre>

<p>If you want to merely replace the contents of the aggregate with aliases to the contents of another aggregate, rather than create a new aggregate, you can force list-assignment by parenthesizing the left side, see below.</p>

</dd>
<dt id="list-assignment"><a id="list"></a>list assignment</dt>
<dd>

<p>List assignment is any assignment where the left-side is an array-slice, hash-slice, or list in parentheses. This behaves essentially like many scalar assignments in parallel.</p>

<pre><code>    alias my (@array) = ($x, $y, $z);
    alias my (%hash) = (x =&gt; $x, y =&gt; $y);
    alias my ($x, $y, @rest) = @_;
    alias @x[0, 1] = @x[1, 0];</code></pre>

<p>Any scalars that appear on the left side must be valid targets for scalar assignment. When an array or hash appears on the left side, normally as the last item, its contents are replaced by the list of all remaining right-side elements. <code>undef</code> can also appear on the left side to skip one corresponding item in the right-side list.</p>

<p>Beware when putting a parenthesised list on the left side. Just like Perl parses <code>print (1+2)*10</code> as <code>(print(1+2))*10</code>, it would parse <code>alias ($x, $y) = ($y, $x)</code> as <code>(alias($x, $y)) = ($y, $x)</code> which does not do any aliasing, and results in the &quot;Useless use of alias&quot; warning, if warnings are enabled.</p>

<p>To circumvent this issue, you can either one of the following:</p>

<pre><code>    alias +($x, $y) = ($y, $x);
    alias { ($x, $y) = ($y, $x) };</code></pre>

</dd>
<dt id="Anonymous-aggregate-constructors"><a id="Anonymous"></a>Anonymous aggregate constructors</dt>
<dd>

<p>Return a reference to a new anonymous array or hash, populated with aliases. This means that for example <code>\$hashref-&gt;{x} == \$x</code>.</p>

<pre><code>    my $arrayref = alias [$x, $y, $z];
    my $hashref = alias {x =&gt; $x, y =&gt; $y};</code></pre>

<p>Note that this also works:</p>

<pre><code>    alias my $arrayref = [$x, $y, $z];
    alias my $hashref = {x =&gt; $x, y =&gt; $y};</code></pre>

<p>but this makes the lhs an alias to the temporary, and therefore read-only, reference made by <code>[]</code> or <code>{}</code>. Therefore later attempts to assign to <code>$arrayref</code> or <code>$hashref</code> results in an error. The anonymous aggregate that is referenced behaves the same in both cases obviously.</p>

</dd>
<dt id="Array-insertions"><a id="Array"></a>Array insertions</dt>
<dd>

<p>These work as usual, except the inserted elements are aliases.</p>

<pre><code>    alias push @array, $foo;
    alias unshift @array, $foo;
    alias splice @array, 1, 2, $foo;</code></pre>

<p>An attempt to do any of these on tied (or &quot;magical&quot;) array will result in a &quot;Can&#39;t push/unshift/splice alias onto tied array&quot; error.</p>

</dd>
<dt id="Returning-an-alias"><a id="Returning"></a>Returning an alias</dt>
<dd>

<p>Returns aliases from the current <code>sub</code> or <code>eval</code>. Normally this only happens for lvalue subs, but <code>alias return</code> can be used in any sub. Lvalue subs only work for scalar return values, but <code>alias return</code> can handle a list of return values.</p>

<p>A sub call will very often copy the return value(s) immediately after they have been returned. <code>alias return</code> can&#39;t prevent that. To pass an alias through a sub return and into something else, the call site must process the return value using an aliasing operation, or at least a non-copying one. For example, ordinary assignment with the sub call on the right hand side will copy, but if the call site is in the scope of an <code>alias</code> pragma then the assignment will instead alias the return value.</p>

<p>When alias-returning a list of values from a subroutine, each individual value in the list is aliased. The list as a whole is not aliasable; it is not an array. At the call site, a list of aliases can be captured into separate variables or into an array, by an aliasing list assignment.</p>

</dd>
<dt id="Subroutines-and-evaluations"><a id="Subroutines"></a>Subroutines and evaluations</dt>
<dd>

<p>Placing a subroutine or <code>eval STRING</code> inside <code>alias</code> causes it to be compiled with aliasing semantics entirely. Additionally, the return from such a sub or eval, whether explicit using <code>return</code> or implicitly the last statement, will be an alias rather than a copy.</p>

<pre><code>    alias { sub foo { $x } };

    my $subref = alias sub { $x };
    
    my $xref1 = \foo;
    my $xref2 = \alias eval &#39;$x&#39;;
    my $xref3 = \$subref-&gt;();</code></pre>

<p>Explicitly returning an alias can also be done using <code>alias return</code> inside any subroutine or evaluation.</p>

<pre><code>    sub foo { alias return $x; }
    my $xref = \foo;</code></pre>

</dd>
<dt id="Localization">Localization</dt>
<dd>

<p>Use of local inside <code>alias</code> usually behaves the same as local does in general, however there is a difference if the variable is tied: in this case, Perl doesn&#39;t localise the variable at all but instead preserves the tie by saving a copy of the current value, and restoring this value at end of scope.</p>

<pre><code>    alias local $_ = $string;</code></pre>

<p>The aliasing semantics of <code>local</code> avoids copying by always localizing the variable itself, regardless of whether it is tied.</p>

</dd>
</dl>

<h1 id="IMPLEMENTATION">IMPLEMENTATION</h1>

<p>This module does <b>not</b> use a source filter, and is therefore safe to use within eval STRING. Instead, Data::Alias hooks into the Perl parser, and replaces operations within the scope of <code>alias</code> by aliasing variants.</p>

<p>For those familiar with perl&#39;s internals: it triggers on a ck_rv2cv which resolves to the imported <code>alias</code> sub, and does a parser hack to allow the <code>alias BLOCK</code> syntax. When the ck_entersub is triggered that corresponds to it, the op is marked to be found later. The actual work is done in a peep-hook, which processes the marked entersub and its children, replacing the pp_addrs with aliasing replacements. The peep hook will also take care of any subs defined within the lexical (but not dynamical) scope between the ck_rv2cv and the ck_entersub.</p>

<h1 id="KNOWN-ISSUES"><a id="KNOWN"></a>KNOWN ISSUES</h1>

<dl>

<dt id="Lexical-variables"><a id="Lexical"></a>Lexical variables</dt>
<dd>

<p>When aliasing existing lexical variables, the effect is limited in scope to the current subroutine and any closures create after the aliasing is done, even if the variable itself has wider scope. While partial fixes are possible, it cannot be fixed in any reliable or consistent way, and therefore I&#39;m keeping the current behaviour.</p>

<p>When aliasing a lexical that was declared outside the current subroutine, a compile-time warning is generated &quot;Aliasing of outer lexical variable has limited scope&quot; (warnings category &quot;closure&quot;).</p>

</dd>
</dl>

<h1 id="ACKNOWLEDGEMENTS">ACKNOWLEDGEMENTS</h1>

<p>Specials thanks go to Elizabeth Mattijsen, Juerd Waalboer, and other members of the Amsterdam Perl Mongers, for their valuable feedback.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Matthijs van Duin &lt;xmath@cpan.org&gt; developed the module originally, and maintained it until 2007. Andrew Main (Zefram) &lt;zefram@fysh.org&gt; updated it to work with Perl versions 5.11.0 and later.</p>

<h1 id="LICENSE">LICENSE</h1>

<p>Copyright (C) 2003-2007 Matthijs van Duin. Copyright (C) 2010, 2011, 2013, 2015, 2017 Andrew Main (Zefram) &lt;zefram@fysh.org&gt;. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Data::Alias, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Data::Alias</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Data::Alias</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Data::Alias.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
